package com.decent.ejfadmin.config;

import com.decent.ejfadmin.interceptor.WebLogInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 记录日志拦截器配置
 *
 * @author weicx
 * @date 2018/08/22
 */
@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter {

    /**
     * 日志打印拦截器注册
     *
     * @param registry 拦截器注册实体
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new WebLogInterceptor())
                .addPathPatterns("/**")
                .excludePathPatterns("/js/**", "/css/**", "/images/**", "/fonts/**");
    }
}
